package org.benjamin.lending.controller;

import java.util.List;

import org.benjamin.lending.domain.entity.BorrowProduct;
import org.benjamin.lending.service.BorrowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "borrowApply")
public class BorrowApplyController {
	
	@Autowired
	private BorrowService borrowService;
	
	@RequestMapping(value = "index")
	public String index(ModelMap modelMap) {
		List<BorrowProduct> borrowProducts = this.borrowService.findProductList();
		modelMap.addAttribute("borrowProducts",borrowProducts);
		return "borrowApply.index";
	}
	
	@RequestMapping(value = "application/{id}")
	public String application(@PathVariable("id")Integer id){
		
		return "borrowApply.application";
	}

}
